<script language="javascript" type="text/javascript">   
Joomla.submitform = function(pressbutton) {
	if (pressbutton != 'toExcel' && pressbutton != 'toPDF') {
		var form = document.adminForm;
		form.task.value = '';			
	}
		
	submitform(pressbutton);
};   
</script>

<form action="" method="post" name="adminForm">
	<fieldset id="filter-bar">
		<div class="filter-search fltlft">
			<label class="filter-search-lbl" for="filter_search"><?php echo JText::_('Name'); ?></label>
			<input type="text" name="filter_name" id="filter_name" value="<?php echo $this->filter_name?>" />

			<button type="submit" name="filter_button" value="filter" onclick="Joomla.submitbutton('view')"><?php echo JText::_('JSEARCH_FILTER_SUBMIT'); ?></button>
		</div>
		<div class="filter-select fltrt">             
		</div>
	</fieldset>
	<table class="adminlist">
		<thead>	
			<tr>
				<th width="5%">
					<input type="checkbox" name="toggle" value="" onclick="checkAll(<?php echo $this->TOTAL_ROW;?>);" />
				</th>
				<th class="title" width="10%">
					<?php echo JHtml::_('grid.sort', 'Code', 'p.code', $this->FORM_ORDER_DIR, $this->FORM_ORDER); ?>
				</th>					
				<th class="title" >
					<?php echo JHtml::_('grid.sort', 'Name', 'p.name', $this->FORM_ORDER_DIR, $this->FORM_ORDER); ?>
				</th>			
				<th class="title" width="10%">
					<?php echo JHtml::_('grid.sort', 'Phone', 'p.phone', $this->FORM_ORDER_DIR, $this->FORM_ORDER); ?>
				</th>
				<th class="title" width="15%">
					<?php echo JHtml::_('grid.sort', 'Address', 'p.address', $this->FORM_ORDER_DIR, $this->FORM_ORDER); ?>
				</th>
				<th class="title" width="15%">
					<?php echo JHtml::_('grid.sort', 'Representative', 'p.representative', $this->FORM_ORDER_DIR, $this->FORM_ORDER); ?>
				</th>
				<th class="title" width="15%">
					<?php echo JHtml::_('grid.sort', 'Email', 'p.email', $this->FORM_ORDER_DIR, $this->FORM_ORDER); ?>
				</th>
				<th class="title" width="10%">
					<?php echo JHtml::_('grid.sort', 'User Name', 'user_name', $this->FORM_ORDER_DIR, $this->FORM_ORDER); ?>
				</th>
			</tr>
		</thead>
		<tfoot>
			<tr>
				<td colspan="14">
					<?php echo $this->LIST_FOOTER_PAV;?>
				</td>
			</tr>
		</tfoot>
		<tbody>
			<?php if($this->TOTAL_ROW) {
					$i = 0;
					foreach($this->dbrow as $key=>$value) {
					 	$checked = JHTML::_('grid.checkedout', $value, $i );
					 	$css_row = $i%2 ? 'row0':'row1'; 
			?>
						<tr class="<?=$css_row?>">
							<td align="center"><?php echo $checked;?></td>
							<td align="center">
								<a href="<?php echo JRoute::_('index.php?option=com_manager&c=pond&task=edit&cid[]='.$value->id)?>"
									title="<?php echo $value->code;?>"> <?php echo $value->code;?> </a>
							</td>
							<td align="center">
								<?php echo $value->name;?>
							</td>
							<td align="center">
								<?php echo $value->phone?>
							</td>
							<td align="center">
								<?php echo $value->address?>
							</td>
							<td align="center">
								<?php echo $value->representative?>
							</td>
							<td align="center">
								<?php echo $value->email?>
							</td>
							<td align="center">
								<?php echo $value->user_name?>
							</td>	
						</tr>
			<?php
						$i++;
					}
				} 
			?>	
		</tbody>
	</table>
			
	<input type="hidden" name="option" value="com_manager" />
	<input type="hidden" name="c" value="pond" />
	<input type="hidden" name="task" value="" />
	<input type="hidden" name="boxchecked" value="0" />
	<input type="hidden" name="filter_order" value="<?php echo $this->FORM_ORDER;?>" />
	<input type="hidden" name="filter_order_Dir" value="<?php echo $this->FORM_ORDER_DIR;?>" />
	<?php echo $this->FORM_TOKEN;?>
</form>
